import request from '@/utils/request'

export function listRoles(param){
  return request({
    url:'/admin/roles',
    method:'get',
    params:param
  })
}

export function listResourceOption(){
  return request({
    url:'/admin/role/resources',
    method:'get'
  })
}

export function listMenuOptions(){
  return request({
    url:'/admin/role/menus',
    method:'get'
  })
}

export function deleteRoles(data){
  return request({
    url:'/admin/roles',
    method:'delete',
    data:data.data
  })
}

export function saveOrUpdateRole(data){
  return request({
    url:'/admin/role',
    method:'post',
    data:data
  })
}

export function updateRoleDisable(data) {
  return request({
    url:'/admin/roles/disable',
    method:'put',
    data:data
  })
}
